import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import refresh from '@dfeidao/atom-web/url/refresh';
import get from '@dfeidao/atom-web/local/get';

export default async function a003(fd: IFeidaoAiBrowserComponent) {
	// todo
	//删除按钮
	const a_no = get(fd, "plan_cla_attr_no");
	const a_name = get(fd, "plan_cla_attr_name")
	const t_no = get(fd, "plan_type_no")
	const t_name = get(fd, "plan_type_name")
	const pd = get(fd, "panduan")
	if (pd === 0) {
		const r = await nodejs<{ code: 0 | 1 }>('liuxinyu/zj-000006/s001', {
			filter: {
				plan_cla_attr_no: a_no,
				plan_cla_attr_name: a_name,
			}
		})
		console.log(r);
		if (r.code === 1) {
			alert("删除计划分类成功")
			refresh();
		}
	} else {
		const r = await nodejs<{ code: 0 | 1 }>('liuxinyu/zj-000006/s002', {
			filter: {
				plan_type_no: t_no,
				plan_type_name: t_name,
			}
		})
		console.log(r);
		if (r.code === 1) {
			alert("删除计划类型成功")
			refresh();
		}

	}


}
